package leetcode20211001;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LUYAO
 * Date: 2021-10-01
 * Time: 21:57
 */
public class FindMissing {
    public static void main(String[] args) {

    }
}

class Solution3 {
    public int missingNumber(int[] nums) {
        //不好，看一下二分法！！！
        for (int i = 0; i < nums.length; i++) {
            if(!(nums[i] == i )){
                return i;
            }
        }
        return nums.length;
    }
}
